//
//  MapViewController.h
//  TabulaImaginarius2
//
//  Created by TA2 on 4/17/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "Maps.h"
#import "MapScrollView.h"
#import "ScrollTimingView.h"
#import "SelectionImageView.h"
#import "SelectionScrollView.h"
#import "LoadedImages.h"
#import "NetworkController.h"
#import "BackgroundProtocol.h"
#import "TokenProtocol.h"
#import "PlayerProtocol.h"
#import "DrawProtocol.h"

@interface MapViewController : UIViewController {
    NSString *currentMapName;
	IBOutlet MapScrollView *mainMapView;
	IBOutlet SelectionScrollView *mainSelectionView;
	IBOutlet ScrollTimingView *scrollView;
	IBOutlet ScrollTimingView *tokenScrollView;
    IBOutlet UIButton    *eraserButton;
    IBOutlet UIButton    *mainBackgroundButton;
    IBOutlet UIButton    *freehandDrawingButton;
    IBOutlet UIButton    *snapDrawingButton;
    IBOutlet UIButton    *backgroundButton;
    IBOutlet UIButton    *objectButton;
    IBOutlet UIButton    *tokenButton;
    IBOutlet UIButton    *toolBarRemoveButton;
    IBOutlet UIButton    *toolBarReturnButton;
    IBOutlet UIButton    *mainMenuRemoveButton;
    IBOutlet UIButton    *mainMenuReturnButton;
    IBOutlet UIView      *toolView;
    IBOutlet UIView      *menuView;
    IBOutlet UIView      *dimmingViewOutlet;
    IBOutlet UIActivityIndicatorView *workInProgressView;
    CABasicAnimation     *fadeIn;
    CABasicAnimation     *fadeOut;
    Map                  *map;
}

@property (nonatomic, assign) ScrollTimingView *scrollView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)bundle withMapName:(NSString *)mapName;
- (Map *)createNewMap:(NSString *)name withBackgroundImage:(NSString *)backgroundPath;
- (void)loadMap;
- (void)displayMap;
- (IBAction)doSnapToGridButton:(id)sender;
- (void)snapOn;
- (void)snapOff;
- (IBAction)doErase:(id)sender;
- (void)eraseOn;
- (void)eraseOff;
- (IBAction)doChangeToTokenView:(id)sender;
- (void)tokenOn;
- (void)tokenOff;
- (IBAction)doDraw:(id)sender;
- (void)drawOn;
- (void)drawOff;
- (IBAction)doBackground:(id)sender;
- (void)backgroundOn;
- (void)backgroundOff;
- (IBAction)doPlayOn:(id)sender;
- (IBAction)doPlayOff:(id)sender;
- (IBAction)doMenuOn:(id)sender;
- (IBAction)doMenuOff:(id)sender;
- (IBAction)doAllBackground:(id)sender;
- (void)backgroundAllOn;
- (void)backgroundAllOff;
- (IBAction)doObject:(id)sender;
- (void)objectOn;
- (void)objectOff;
- (IBAction)doCenterGrid:(id)sender;
- (IBAction)doCenterGridAtHost:(id)sender;
- (IBAction)doGrid:(id)sender;
- (IBAction)doSave:(id)sender;
- (IBAction)doClear:(id)sender;
- (void)saveMap;
- (void)disableUI;
- (void)enableUI;
- (IBAction)doLogout:(id)sender;
- (void)releaseResources;
- (void)fade:(UIView *)view fromValue:(float)fromValue toValue:(float)toValue withDuration:(float)duration;

@end
